#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
void mean()
{
	printf("1 play\n");
	printf("0 exit\n");
}
void game()
{
	int x = rand() % 100 + 1;
	int y = 0;
	while (1)
	{
		printf("开始游戏\n");
		scanf("%d", &y);
		if (x > y)
		{
			printf("猜小了\n");
		}
		else if (x < y)
		{
			printf("猜大了\n");
		}
		else
		{
			printf("恭喜，猜对了\n");
			break;
		}
	}
}
int main()
{
	int input = 0;
	srand((unsigned int)time(NULL));
	do
	{
		mean();
		scanf("%d", &input);
		switch (input)
		{
		case 0:
			printf("退出游戏\n");
			break;
		case 1:
			game();
			break;
		default:
			printf("选择错误，请重新选择\n");
		}
	} while (input);
}